__author__ = 'belal'
from Reservation.models import UserProfile
from django.contrib.auth.models import User
from django import forms
from django.contrib.admin.widgets import AdminDateWidget

GUEST_NUMBER = (
             (1, '1'),
             (2, '2'),
             (3, '3'),
)
class UserForm(forms.ModelForm):
    username = forms.CharField(widget=forms.TextInput(attrs={'class' : 'form-control'}),help_text="Please enter a username.")
    email = forms.CharField(widget=forms.TextInput(attrs={'class' : 'form-control'}),help_text="Please enter your email.")
    password = forms.CharField(widget=forms.PasswordInput(attrs={'class' : 'form-control'}), help_text="Please enter a password.")

    class Meta:
        model = User
        fields = ['username', 'email', 'password']


class UserProfileForm(forms.ModelForm):
    Address = forms.CharField(widget=forms.TextInput(attrs={'class' : 'form-control'}),help_text="Please enter your Address", required=False)
    City = forms.CharField(widget=forms.TextInput(attrs={'class' : 'form-control'}),help_text="Please enter your city", required=False)
    Mobile = forms.IntegerField(widget=forms.TextInput(attrs={'class' : 'form-control'}),help_text="Please enter your Mobile")

    class Meta:
        model = UserProfile
        fields = ['Address', 'City','Mobile']

class SearchForm(forms.Form):
    Destination=forms.CharField(widget=forms.TextInput(attrs={'class' : 'form-control'}),help_text="Please enter your Destination", required=True,error_messages={'required': 'Please Enter valid Destination'})
    HotelName=forms.CharField(widget=forms.TextInput(attrs={'class' : 'form-control'}),help_text="Please Desired Hotel", required=True,error_messages={'required': 'Please Enter valid Destination'})
    CheckInDate = forms.DateField( widget=forms.widgets.DateInput(attrs={'class' : 'form-control'},format="%m/%d/%Y"),help_text="Enter CheckIn Date(d/m/y)",error_messages={'required': 'Please Enter valid Destination'})
    CheckOutDate=forms.DateField(widget=forms.DateInput(attrs={'class' : 'form-control'},format="%d/%m/%Y"),help_text="Enter CheckIn Date(d/m/y)",error_messages={'required': 'Please Enter valid Destination'})
    Guests=forms.ChoiceField(widget=forms.Select(attrs={'class' : 'form-control'}),required=False,choices=GUEST_NUMBER)